<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="menuList" value="${fns:getMenuList()}" />
<c:set var="firstMenu" value="true" />
<c:forEach items="${menuList}" var="menu" varStatus="idxStatus">
	<c:if test="${menu.parent.id eq (not empty param.parentId ? param.parentId:1)&&menu.isShow eq '1'}">
		<c:choose>
			<c:when test="${not empty menu.href}">
			<li class="menu-${param.parentId}">
				<a class="J_menuItem" ${firstMenu?'target="mainFrame"':''} data-index="${idxStatus.index}" href="${fn:indexOf(menu.href, '://') eq -1 ? ctx : ''}${not empty menu.href ? menu.href : '/404'}">
					<i class="glyphicon glyphicon-${not empty menu.icon? menu.icon:'circle'}">&nbsp;</i>
					<span class="nav-label">${menu.name}</span>
				</a>
			</li>
			</c:when>
			<c:otherwise>
			<li class="menu-${param.parentId}">
				<a href="#">
					<i class="glyphicon glyphicon-${not empty menu.icon? menu.icon:'circle'}"></i>
					<span class="nav-label">${menu.name}</span>
					<span class="fa arrow"></span>
				</a>
				<ul class="nav nav-second-level collapse" aria-expanded="false" style="height: 0px;">
					<c:forEach items="${menuList}" var="menu2" varStatus="">
						<c:if test="${menu2.parent.id eq menu.id&&menu2.isShow eq '1'}">
							<c:choose>
								<c:when test="${not empty menu2.href}">
								<li>
									<a ${firstMenu?'target="mainFrame"':''} class="J_menuItem"
									href="${fn:indexOf(menu2.href, '://') eq -1 ? ctx : ''}${not empty menu2.href ? menu2.href : '/404'}">
										<c:if test="${not empty menu2.icon}">
										<i class="${menu2.icon}">&nbsp;</i>
										</c:if>
										<span class="nav-label">${menu2.name}</span>
									</a>
								</li>	
								</c:when>
								<c:otherwise>
								<li>
									<a href="#">
										<c:if test="${not empty menu2.icon}">
										<i class="${menu2.icon}">&nbsp;</i>
										</c:if>
										<span class="nav-label">${menu2.name}</span>
										<span class="fa arrow"></span>
									</a>
									<ul class="nav nav-third-level collapse">
										<c:forEach items="${menuList}" var="menu3">
											<c:if test="${menu3.parent.id eq menu2.id&&menu3.isShow eq '1'}">
											<a ${firstMenu?'target="mainFrame"':''} class="J_menuItem" href="${fn:indexOf(menu3.href, '://') eq -1 ? ctx : ''}${not empty menu3.href ? menu3.href : '/404'}">${menu3.name}</a>
											</c:if>
										</c:forEach>
									</ul>
								</li>
								</c:otherwise>
							</c:choose>
							<c:set var="firstMenu" value="false" />
						</c:if>
					</c:forEach>
				</ul>
			</li>
			</c:otherwise>
		</c:choose>
	</c:if>
</c:forEach>
<%--
</body>
</html> --%>